<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>login</title>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.0/jquery.min.js"></script>

<script type="text/javascript">

	

$(function(){


	$('#btn').click(function(event) {
	 
	 	var email= $('#email').val();
	var password=$('#password').val();

 $.ajax({
            //请求方式
            type : "POST",
            //请求的媒体类型
            url : '/api/user/login/'+email+'/'+password,
            //请求成功
            success : function(result) {
                 console.log(result);

                if(result==false){
                    alert('没有注册或者密码不对')
                }
                else location.href='./index.html?email='+email;
            },
            //请求失败，包含具体的错误信息
            error : function(e){

                  alert(e.responseText);
            }
        });
	});

})


 


</script>

</head>
<body>

		 
		邮箱 <input id="email" type="text" name="email"> <br>
		密码 <input id="password" type="password" name="password"> <br>
		<button id="btn" type="button"  >登陆</button>  <br>
		<a href="./reg.html">注册新账号</a>



</body>
</html>